<?php

namespace App\Models\Scm;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class InboundDetail extends Model
{
    use HasFactory;
    public $timestamps = FALSE;
    protected $table = 'biz_inbound_detail';
    protected $fillable = ['id', 'inbound_id', 'qc_detail_id', 'material_id', 'inbound_quantity', 'del_flag', 'out_warehouse', 'kingdee_assist_qty', 'kingdee_wzsqbh', 'cost_center_org_unit', 'warehouse', 'kingdee_unit', 'out_location', 'pur_order_number',
                            'kingdee_assist_unit', 'kingdee_seq', 'kingdee_parent', 'location', 'kingdee_scrw', 'kingdee_qty', 'kingdee_expense_type_id', 'order_id', 'inbound_unit', 'requisition_detail_id', 'kingdee_base_status', 'kingdee_biz_date', 'sync_time'];

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
    }

    public function insertOne($params){
        return self::create($params);
    }

    public function insertMany($params){
        return self::insert($params);
    }
    
    public function updateById($params, $id){
        return self::where("id", $id)->update($params);
    }
    
    public function findRowById($id){
        return self::whereRaw('BINARY id = ?', [$id])->first();
    }
}
